<?
	class News_m extends Model{
		function News_m(){
			parent::Model();	
		}
		
		function retr_frontpage_idx(){
			$idx = 	$this->db->query("SELECT * FROM frontpage_news");
			$i=0;
			foreach ($idx->result() as $row){
				$idxs[$i] = $row->id;	
				$i++;
			}
			return $idxs;
		}
		
		function retr_news($id){
			$hasil = $this->db->query("SELECT * FROM news WHERE id=". $id);
			$i=0;
			foreach ($hasil->result() as $row){
				$hsl[$i] = array(
					"id" => $row->id,
					"title" => $row->title,
					"date" => $row->date,
					"introtext" => $row->introtext,
					"fulltext" => $row->fulltext,
					"author" => $row->author
				);
				$i++;
			}
			return $hsl;
		}
	}

?>